home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 2002 November / SGI Freeware 2002 November - Disc 2.iso / dist / fw_gnome-user-docs.idb / usr / freeware / share / gnome / help / unix-primer / C / unix-primer.sgml.z / unix-primer.sgml
SGML Document  |  2001-10-10  |  39KB

  1. <!DOCTYPE article PUBLIC "-//GNOME//DTD DocBook PNG Variant V1.1//EN"[
  2. ]>
  3. <article id="index"> 
  4.  
  5.   <artheader> 
  6.     <title> If you are new to Linux/UNIX</title>
  7.     <copyright>
  8.       <year>2000, 2001</year>
  9.       <holder>Alexander Kirillov</holder>
  10.     </copyright>
  11.  
  12.       <legalnotice id="legalnotice">
  13.       <para>
  14.         Permission is granted to copy, distribute and/or modify this
  15.         document under the terms of the <ulink type="help"
  16.         url="gnome-help:fdl"><citetitle>GNU Free Documentation
  17.         License</citetitle></ulink>, Version 1.1 or any later version
  18.         published by the Free Software Foundation with no Invariant
  19.         Sections, no Front-Cover Texts, and no Back-Cover Texts. You
  20.         may obtain a copy of the <citetitle>GNU Free Documentation
  21.         License</citetitle> from the Free Software Foundation by
  22.         visiting <ulink type="http" url="http://www.fsf.org">their Web
  23.         site</ulink> or by writing to: Free Software Foundation, Inc.,
  24.         59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  25.       </para>
  26.     
  27.     <para>
  28.       Many of the names used by companies to distinguish their
  29.       products and services are claimed as trademarks. Where those
  30.       names appear in any GNOME documentation, and those
  31.       trademarks are made aware to the members of the GNOME
  32.       Documentation Project, the names have been printed in caps
  33.       or initial caps.
  34.     </para>
  35.       </legalnotice>
  36.  
  37.     <releaseinfo>
  38.       This document was last updated on April 25, 2001.
  39.     </releaseinfo>
  40.  
  41.     </artheader>
  42. <sect1 id="introduction"> 
  43.     <title>Introduction</title>
  44.  
  45.   <para> One of the goals of GNOME is to make your system easy to use,
  46.     without requiring you to learn the technical details about your
  47.     operating system.  However, there are some basic UNIX notions that
  48.     you have to be familiar with even while using the easy graphical
  49.     interface provided by GNOME. For the convenience of new users,
  50.     these basics are collected in this document. If you need further
  51.     information on UNIX, you should read the documentation which came
  52.     with your system; there are also a number of books and on-line
  53.     guides available for all versions of UNIX.
  54.   </para>
  55.  
  56.   <para> The following guide applies to all versions of UNIX and
  57.     UNIX-like operating systems, including both the commercial Unices
  58.     such as <systemitem>Solaris</systemitem> and open-source operating
  59.     systems such as <systemitem>FreeBSD</systemitem> and
  60.     <systemitem>Linux</systemitem>. Some of the material here is based
  61.     on <citetitle>Linux Installation and Getting Started</citetitle>
  62.     guide, by Matt Welsh, Phil Hughes, David Bandel, Boris Beletsky,
  63.     Sean Dreilinger, Robert Kiesling, Evan Leibovitch, and Henry
  64.     Pierce. The guide is available for download or online viewing from
  65.     the <ulink url="http://www.linuxdoc.org" type="http">Linux
  66.     Documentation Project</ulink> or from the <ulink
  67.     url="http://www.oswg.org">Open Source Writers Group</ulink>.
  68.   </para>
  69.   </sect1>
  70.  
  71.  <sect1 id="new-users">
  72.     <title>Users</title> 
  73.     <para> UNIX is a multiuser operating system: it
  74.       was designed to allow many users to work on the same computer,
  75.       either simultaneously (using several terminals or network
  76.       connections) or in turns. Under UNIX, to identify yourself to
  77.       the system, you must log in, which entails entering your
  78.       <emphasis>login name</emphasis> (the name the system uses to identify
  79.       you) and your <emphasis>password</emphasis>, which is your personal key
  80.       for logging in to your account. Because only you know your
  81.       password, no one else can log in to the system under your user
  82.       name. Usually people choose their first or last name or some
  83.       variation of it as their login name, so that if your real name
  84.       is Sasha Beilinson, your login might be <systemitem>sasha</systemitem>.
  85.     </para>
  86.     <para> Each user has a separate place to keep his files (called
  87.       his <emphasis>home directory</emphasis>). UNIX has a system of
  88.       permissions (see <xref linkend="permissions">), so that on a
  89.       properly configured UNIX system a user can't change other users'
  90.       or system files. This also allows every user to customize
  91.       various aspects of the system — in particular, GNOME
  92.       behavior — for himself, without affecting other users.
  93.     </para>
  94.     <para> On any UNIX system there is also a special user, called
  95.       <emphasis>system administrator</emphasis>, with the login name
  96.       <systemitem>root</systemitem>. He has <emphasis>full</emphasis>
  97.       control over the system — including full access to all the
  98.       system and users' files. He has the authority to change the
  99.       passwords of existing users and add new users, install and
  100.       uninstall software, and so on. The system administrator is
  101.       usually the person responsible for proper functioning of the
  102.       system, so if you have some problems, you should ask him.
  103.     </para>
  104.     <important>
  105.       <title>IMPORTANT</title>
  106.       <para>
  107.     Even if you are the only user on your computer (for example,
  108.     if the computer is your personal workstation), so that you are
  109.     also the system administrator, it is important that you create
  110.     a user account and use it for daily work, logging in as root
  111.     only when necessary for system maintenance. Because root can
  112.     do anything, it is easy to make mistakes that have
  113.     catastrophic consequences.  Picture the root account as a
  114.     magic hat that gives you lots of power, with which you can, by
  115.     waving your hands, create or destroy entire cities.  Because
  116.     it is easy to wave your hands in a destructive manner, it is
  117.     not a good idea to wear the magic hat when it is not needed,
  118.     despite the wonderful feeling.
  119.       </para>
  120.     </important>
  121.   </sect1>
  122.   <sect1 id="new-file">
  123.     <title>Files and filenames</title>
  124.     <para>
  125.       Under most operating systems (including UNIX), there is the
  126.       concept of a <emphasis>file</emphasis>, which is just a bundle of
  127.       information given a name (called a
  128.       <emphasis>filename</emphasis>). Examples of files might be
  129.       your history term paper, an e-mail message, or an actual
  130.       program that can be executed. Essentially, anything saved on
  131.       disk is saved in an individual file.
  132.     </para>
  133.     <sect2 id="new-filenames">
  134.       <title>Filenames</title>
  135.       <para>
  136.     Files are identified by their filenames. For example, the file
  137.     containing your conference talk might be saved with the filename
  138.     <filename>talk.txt</filename>. There is no standard format for file
  139.     names as there is under MS-DOS and some other operating systems; in
  140.     general, a filename can contain any character (except the /
  141.     character–see the discussion of path names below) and is
  142.     limited to 256 characters in length.
  143.       </para>
  144.       <important>
  145.     <title>IMPORTANT</title>
  146.     <para>
  147.       Unlike MS-DOS, the filenames in UNIX are case-sensitive:
  148.       <filename>myfile.txt</filename> and
  149.       <filename>MyFile.txt</filename> are considered as two
  150.       different files.
  151.     </para>
  152.       </important>
  153.       <para>
  154.     You should also be aware of several UNIX conventions; while they are
  155.     not mandatory, it is usually a good idea to follow them.
  156.     <itemizedlist>
  157.       <listitem>
  158.         <para> It is customary to use the format
  159.           <filename>filename.extension</filename> for filenames,
  160.           where the extension indicates the file type; for
  161.           example, the extension <filename>txt</filename> is
  162.           usually used for plain text files, while the extension
  163.           <filename>jpeg</filename> is used for graphics in JPEG
  164.           format, and so on. In particular, the <application>GNOME
  165.           File Manager</application>
  166.           (<application>Nautilus</application>) uses extensions to
  167.           determine file type. You can view or change file
  168.           extensions recognized by
  169.           <application>GNOME</application> by selecting the
  170.           section <menuchoice><guimenu>Document Handlers</guimenu>
  171.           <guimenuitem>MIME types</guimenuitem> </menuchoice> in
  172.           <application>GNOME Control Center</application>.  Note
  173.           that the standard convention in UNIX is that the
  174.           <emphasis>executables</emphasis> (i.e., the program
  175.           files) have no extension at all.
  176.             </para>
  177.           </listitem>
  178.       
  179.       <listitem>
  180.         <para> Files and directories whose names begin with a dot
  181.           (.) are usually <emphasis>configuration
  182.         files</emphasis>, that is, files which keep settings and
  183.           preferences for various applications. For example, GNOME
  184.           keeps all its settings in various files in the directories
  185.           <filename>.gnome</filename> and
  186.           <filename>.gnome-desktop</filename> in the user's home
  187.           directory. Since most of the time you do not need to
  188.           edit these files manually, or even know their precise
  189.           names and locations, <application>Nautilus</application>
  190.           usually doesn't show these files. You can change this
  191.           setting as described in <ulink type="help"
  192.           url="gnome-help:nautilus">Nautilus manual</ulink>. 
  193.         </para>
  194.       </listitem>
  195.       
  196.       <listitem> 
  197.         <para> Files with names ending with tilde (~) are
  198.           usually backup files created by various
  199.           applications. For example, when you edit a file
  200.           <filename> myfile.txt</filename> with
  201.         <application>emacs</application>, it 
  202.           saves the previous version in the file
  203.           <filename>myfile.txt~</filename>.
  204.         </para>
  205.       </listitem>
  206.     </itemizedlist>
  207.       </para>
  208.     </sect2>
  209.     <sect2 id="new-wildcards">
  210.       <title> Wildcards</title> 
  211.  
  212.       <para>When entering commands from the command line, you can use
  213.     so-called <emphasis>wildcards</emphasis> instead of an exact
  214.     filename. The most common wildcard is *, which matches any
  215.     sequence of symbols (including an empty string). For example,
  216.     the command <command>ls *.txt</command> will list all the files with
  217.     the extension <filename>txt</filename>, and the command <command>rm
  218.       chapter*</command> will remove all files with the names starting with
  219.     <filename>chapter</filename> (<command>ls</command> and
  220.     <command>rm</command> are UNIX 
  221.     commands for listing and removing files). Another useful
  222.     wildcard is ?, which matches any single symbol: for example,
  223.     <command>rm chapter?.txt</command> will remove files
  224.     <filename>chapter1.txt, chapter2.txt</filename> , but not
  225.     <filename>chapter10.txt</filename>
  226.       </para>
  227.       <para>Most new GNOME users prefer using the <application>GNOME
  228.       File Manager</application> for operations with files, rather
  229.       than working from the command line. Wildcards can also be
  230.       used in  <application>Nautilus</application> in the file
  231.       selection and view filter dialogs.  </para>
  232.     </sect2>
  233.  
  234.     <sect2 id="quoting">
  235.       <title>Using spaces, commas, etc. in file names</title>
  236.       <para>
  237.     As was mentioned above, a file name may contain not only
  238.     letters and numbers, but also spaces, commas, etc. — any
  239.     characters other than slash (/). However, if you are using
  240.     commands typed on the command line, you should be careful when
  241.     dealing with such files. To avoid problems, it is advised that
  242.     you enclose  filenames that contain anything other than
  243.     letters, numbers, and dots,  in single quotes: to delete file
  244.     <filename>My File</filename>, you should type <command>rm 'My
  245.     File'</command> rather than <command>rm My
  246.     File</command>.
  247.       </para>
  248.       <para>
  249.     Of course, if you are only using graphical tools such as GNOME
  250.     File Manager, than you do not  need to worry about this: to
  251.     delete file <filename>My File</filename>, just drag it to the
  252.     trash can.
  253.       </para>
  254.     </sect2>
  255.  
  256.   </sect1>
  257.   <sect1 id="new-dirs">
  258.     <title>Directories and paths</title> 
  259.     <sect2 id="new-dirstruct">
  260.       <title>Directory structure</title>
  261.       <para>
  262.     Now, let's discuss the concept of directories. A
  263.     <emphasis>directory</emphasis> is a collection of files. It
  264.     can be thought of as a <quote>folder</quote> that contains
  265.     many different files. Directories are given names, with which
  266.     they can be identified. Furthermore, directories are
  267.     maintained in a tree-like structure; that is, directories may
  268.     contain other directories. The top level directory is called
  269.     the <quote>root directory</quote> and denoted by
  270.     <filename>/</filename>; it contains all the files in your
  271.     system.
  272.       </para>
  273.       <sect3 id="new-path">
  274.     <title>Pathnames</title>
  275.     <para>
  276.       A <emphasis>pathname</emphasis> is a file's <quote>full
  277.       name</quote>; it contains not only filename but also its
  278.       location. It is made up of the filename, preceded by the
  279.       name of the directory containing that file. This, in turn,
  280.       is preceded by the name of directory containing
  281.       <emphasis>that directory</emphasis>, and so on. A typical
  282.       pathname may look like
  283.       <filename>/home/sasha/talk.txt</filename> which refers to
  284.       the file <filename>talk.txt</filename> in the directory
  285.       <filename>sasha</filename> which in turn is a subdirectory
  286.       in <filename>/home</filename>.
  287.     </para>
  288.     <para>
  289.       As you can see, the directory and filename are separated by
  290.       a single slash (/). For this reason, filenames themselves
  291.       cannot contain the / character.  MS-DOS users will find this
  292.       convention familiar, although in the MS-DOS world the
  293.       backslash (\) is used instead. The directory that contains a
  294.       given subdirectory is known as the <emphasis>parent
  295.       directory</emphasis>. Here, the directory
  296.       <filename>home</filename> is the parent of the directory
  297.       <filename>sasha</filename>.
  298.     </para>
  299.     <para>
  300.       Each user has a home directory, which is the directory set aside for
  301.       that user to store his or her files.  Usually, user home directories
  302.       are contained under <filename>/home</filename>, and are named for the
  303.       user owning that directory, so that the home directory of user
  304.       <systemitem>sasha</systemitem> would be 
  305.       <filename>/home/sasha</filename>.
  306.     </para>
  307.       </sect3>
  308.     </sect2>
  309.     <sect2 id="new-relative"> 
  310.       <title>Relative directory names</title>
  311.       <para>
  312.     At any moment, commands that you enter are assumed to be
  313.     <emphasis>relative</emphasis> to your current working
  314.     directory. You can think of your working directory as the
  315.     directory in which you are currently
  316.     <quote>located</quote>. When you first log in, your working
  317.     directory is set to your home directory — for user
  318.     sasha, it would be <filename>/home/sasha</filename>. Whenever
  319.     you refer to a file, you may refer to it in relationship to
  320.     your current working directory, rather than specifying the
  321.     full pathname of the file.
  322.       </para>
  323.       <para>
  324.     For example, if your current directory is
  325.     <filename>/home/sasha</filename>, and you have a file there called
  326.     <filename>talk.txt</filename>, you can refer to it just by its file
  327.     name: a command like <command>emacs talk.txt</command> issued from the
  328.     directory <filename>/home/sasha</filename> is equivalent to
  329.     <command>emacs /home/sasha/talk.txt</command>
  330.     (<application>emacs</application> is an extremely powerful editor for
  331.     text files; new users may prefer something simpler, such as
  332.     <application>gnotepad</application>, but for power user,
  333.     <application>emacs</application> is indispensable).
  334.       </para>
  335.  
  336.  
  337.       <para>
  338.     Similarly, if, in <filename>/home/sasha</filename> you have a
  339.     subdirectory called <filename>papers</filename> and, in that
  340.     subdirectory, a file called <filename>fieldtheory.txt</filename>, you
  341.     can refer to it as <filename>papers/fieldtheory.txt</filename>.
  342.       </para>
  343.       <para> If you begin a filename (like
  344.     <filename>papers/fieldtheory.txt</filename>) with a character
  345.     other than /, you're referring to the file in terms relative
  346.     to your current working directory. This is known as a relative
  347.     pathname.  On the other hand, if you begin a filename with a
  348.     /, the system interprets this as a full pathname — that
  349.     is, a pathname that includes the entire path to the file,
  350.     starting from the root directory, /. Use of the full pathname
  351.     is known as an <emphasis>absolute pathname</emphasis>.
  352.       </para>
  353.     </sect2>
  354.     <sect2 id="new-path-conv">
  355.       <title>Pathname conventions</title> 
  356.       <para>
  357.     Here are some standard conventions you can use in paths: 
  358.       </para>
  359.       <para>
  360.     <filename>~/</filename> — user's home directory
  361.       </para>
  362.       <para>
  363.     <filename>./</filename>  — current working directory
  364.       </para>
  365.       <para>
  366.     <filename>../</filename>  — parent of the current directory
  367.       </para>
  368.       <para>
  369.     For example, if sasha's current directory is
  370.     <filename>/home/sasha/papers</filename>, he can refer to the file
  371.     <filename>/home/sasha/talk.txt</filename> as
  372.     <filename>~/talk.txt</filename> or as <filename>../talk.txt</filename>.
  373.       </para>
  374.     </sect2>
  375.   </sect1>
  376.   <sect1 id="permissions">
  377.     <title>Permissions</title>
  378.     <para>
  379.       Every file on your system has an <emphasis>owner</emphasis> — one
  380.       of the users (usually the one who created this file), and a system of
  381.       <emphasis>permissions</emphasis>, which regulate access to this
  382.       file.
  383.     </para>
  384.     <para>
  385.       For ordinary files, there are 3 types of access permissions:
  386.       read, write, and execute (the latter only makes sense for
  387.       executable files). They can be set independently for 3
  388.       categories of users: the file owner, the users in the group
  389.       owning the file, and everyone else. Discussion of groups of
  390.       users goes beyond the scope of this document; the other two
  391.       categories are self-explanatory.  <!--Which groups of users? I
  392.       don't think the other two categories are self-explanatory. Would
  393.       help if there was some exposition here which explicitly states
  394.       who belongs where.-->So, if the permissions on a file
  395.       <filename>/home/sasha/talk.txt</filename> are set to read and
  396.       write for user sasha, who is the file owner, and read only for
  397.       everyone else, only sasha will be able to modify this file.
  398.       <!--How about adding something in parentheses here, like (Since
  399.       sasha created the file <filename>talk.txt</filename>, sasha has
  400.       the widest range of rights to access the file.)... or something
  401.       like that?-->
  402.     </para>
  403.  
  404.     <para>
  405.       All newly created files carry some standard permissions, usually
  406.       read/write for user and read only for everyone else. You can
  407.       view the permissions using the GNOME File Manager, by
  408.       right-clicking on the file, choosing
  409.       <guimenuitem>Properties</guimenuitem> in the pop-up menu, and
  410.       then the <guilabel>Permissions</guilabel> tab. Using this
  411.       dialog, you can also change the permissions — just click
  412.       on a square representing the permission to toggle it.  Of
  413.       course, only the file owner or the system administrator can
  414.       change the permissions of a file. Advanced users can also change
  415.       the default file permissions which are assigned to newly created
  416.       files—see the manual pages for your default shell (usually
  417.       <command>bash</command>, <command>csh</command> or
  418.       <command>tcsh</command>) and look for the command
  419.       <command>umask</command>.
  420.     </para>
  421.  
  422.     <para>
  423.       A file can also have some special permission properties such as
  424.       UID, GID, and <quote>sticky</quote> bit. They are for advanced
  425.       users only — do not change them unless you know what you
  426.       are doing. (If you are curious: these permissions are typically
  427.       used on executable files to allow the user to execute
  428.       <emphasis>some</emphasis> commands which read or modify files to
  429.       which the user himself doesn't have access.)
  430.     </para>
  431.  
  432.     <para> Similar to files, the directories also have
  433.       permissions. Again, there are 3 possible permissions: read,
  434.       write, and execute. However, they have different meaning:
  435.       namely, <quote>read</quote> permission for a directory means
  436.       permission to list the contents of the directory or search for a
  437.       file; <quote>write</quote> means permission to create and remove
  438.       files in the directory, and <quote>execute</quote> means
  439.       permission to access files in the directory.
  440.     </para>
  441.     <para>
  442.       Note that the permissions granted to a file depend on the
  443.       permissions of the directory in which the file is located: in
  444.       order to be able to read a file, a user needs to have the read
  445.       permission for the file itself and <quote>execute</quote>
  446.       permission for the directory that contains it. So, if user sasha
  447.       doesn't want anybody else to see his files, he can achieve this
  448.       by removing the execute permission on his home directory for all
  449.       other users. This way, no one but himself (and, of course, root)
  450.       will be able to read any of his files, no matter what the
  451.       permissions of individual files are.
  452.     </para>
  453.     <para> Detailed explanation of the permission system can be found,
  454.       for example, in the <ulink type="info" url="info:fileutils">info
  455.       page</ulink> for the GNU <citetitle>File Utilities</citetitle>
  456.       package.
  457.       </para>
  458.   </sect1>
  459.  
  460.   <sect1 id="symlinks">
  461.     <title>Symbolic links</title>
  462.     <para>
  463.       In addition to regular files, UNIX also has special files called
  464.       <emphasis>symbolic links</emphasis> (or
  465.       <emphasis>symlinks</emphasis> for short). These files do not
  466.       contain any data; instead, they are just
  467.       <quote>pointers</quote>, or <quote>shortcuts</quote> to other
  468.       files. For example, sasha can have a symlink named
  469.       <filename>ft.txt</filename> pointing to the file
  470.       <filename>papers/fieldtheory.txt</filename>; this way, when a
  471.       program tries to access the file <filename>ft.txt</filename>,
  472.       the file <filename>papers/fieldtheory.txt</filename> will be
  473.       opened instead. As you can see from this example, the symlink
  474.       and the target file can have different names and be located in
  475.       different directories.
  476.     </para>
  477.     <para> Note that deleting, moving, or renaming the symlink file
  478.       has no effect on the target file: if sasha tries to delete the
  479.       file <filename>ft.txt</filename>, it is the symlink that will
  480.       be deleted, and the file
  481.       <filename>papers/fieldtheory.txt</filename> will remain
  482.       unchanged.  Also, the permissions of the symlink are
  483.       meaningless: it is the permissions of the target file that
  484.       determine whether a user has the access to it.
  485.     </para>
  486.  
  487.     <para> Symlinks can also point to directories.  For example, on
  488.       the GNOME FTP server (<systemitem>ftp.gnome.org</systemitem>),
  489.       there is a file
  490.       <filename>/pub/GNOME/stable/releases/october-gnome</filename>,
  491.       which is actually a  symlink to directory
  492.       <filename>/pub/GNOME/stable/releases/gnome-1.0.53</filename>
  493.       — as one would expect, since <quote>October GNOME</quote>
  494.       is  just another name for 1.0.53 release
  495.       of GNOME.  
  496.     </para>
  497.   </sect1>
  498.   <sect1 id="new-mount">
  499.     <title>Mounting and unmounting drives</title>
  500.     <para>
  501.       As we mentioned earlier, the directories on a UNIX system are
  502.       organized in a tree, with the top level directory being
  503.       <filename>/</filename>. Unlike some other operating systems such as
  504.       MS-DOS, there are no special names for files on your floppy disk or
  505.       CD-ROM: <emphasis>all</emphasis> the files accessible to your system
  506.       must appear in the main directory tree starting with
  507.       <filename>/</filename>.
  508.     </para>
  509.     <para>
  510.       Thus, before you can access files on a floppy diskette or a
  511.       CD-ROM, you must give to your system a command to incorporate
  512.       the contents of this diskette into the main directory tree,
  513.       which is referred to as <emphasis>mounting</emphasis> the
  514.       diskette. You can think of it as the software analog of
  515.       connecting the drive to your system.  Typically the contents of
  516.       the CD-ROM will appear under the name
  517.       <filename>/mnt/cdrom</filename>; the floppy diskette under
  518.       <filename>/mnt/floppy</filename> (these are called the
  519.       <emphasis>mount points</emphasis> and are defined in the special
  520.       configuration file, <filename>/etc/fstab</filename>). Accessing
  521.       a drive in this fashion doesn't mean that the system will copy
  522.       all the files from the CD to the directory
  523.       <filename>/mnt/cdrom</filename>. Instead, it means that the
  524.       directory <filename>/mnt/cdrom</filename>
  525.       <emphasis>represents</emphasis> the CD-ROM: When a program tries
  526.       to access, say, a file called
  527.       <filename>/mnt/cdrom/index.html</filename>, the system will look
  528.       for file <filename>index.html</filename> on the CD-ROM.
  529.     </para>
  530.     <para>
  531.       So, in short: before you can use files on a drive, you must
  532.       <quote>mount</quote> it. Similarly, <emphasis>before removing
  533.       the disk from the drive, you must unmount it.</emphasis>
  534.     </para>
  535.     <para>
  536.       When using GNOME, you usually do not have to worry about
  537.       mounting and unmounting: GNOME scans the appropriate
  538.       configuration file and places the icons for all drives on your
  539.       desktop. Double-clicking on any of these icons automatically
  540.       mounts the corresponding drive (if it was not already mounted)
  541.       and starts the file manager in the appropriate directory.
  542.       Similarly, if you right-click on the drive icon and choose the
  543.       command <guimenuitem>Eject device</guimenuitem> from the pop-up
  544.       menu, GNOME automatically unmounts it before ejecting. You can
  545.       also mount/unmount a drive by right-clicking on its icon on the
  546.       desktop and choosing <guimenuitem>Mount device</guimenuitem> or
  547.       <guimenuitem>Unmount device</guimenuitem> from the pop-up menu,
  548.       or by using the disk mount applet.
  549.     </para>
  550.     <para>
  551.       Note that you can't unmount a drive if it is being used by some
  552.       program; for example, if you have a terminal windows open in a
  553.       directory on the drive you're trying to unmount. So, if you get
  554.       the error message <quote>Device busy</quote> while trying to
  555.       unmount a drive, make sure that none of your open applications
  556.       is accessing a file or directory on this drive.
  557.     </para>
  558.     <para>
  559.       However, GNOME cannot prevent you from ejecting the disk using the
  560.       physical eject button on the drive itself — in this case,
  561.       <emphasis>it is your responsibility to unmount the drive</emphasis>
  562.       before doing so. For CD and Zip drives, the system blocks the eject
  563.       button on the drive while the drive is mounted; for floppy drives this
  564.       is technically impossible.
  565.     </para>
  566.  
  567.     <important>
  568.       <title>IMPORTANT</title>
  569.       <para>
  570.     If you eject a floppy  disk using the eject button on the drive without
  571.     first unmounting it, you may lose your data!
  572.       </para>
  573.     </important>
  574.  
  575.     <para> Some systems are running special programs such as
  576.       <application>supermount</application> or
  577.       <application>magicdev</application>
  578.       which automatically mount a drive when a disk is inserted and unmount a
  579.       drive if it hasn't been used for a specified period of time. In
  580.       this case, you will probably never need to worry about
  581.       mounting/unmounting drives yourself; you don't even need to read
  582.       this section. 
  583.     </para>
  584.     <para>
  585.       Allowing users to mount and unmount drives carries some security
  586.       risks, so many multi-user systems are configured so that only
  587.       root can mount or unmount drives. This is the most probable
  588.       cause of error messages you may be getting while trying to mount
  589.       a drive. In this case, discuss this matter with your system
  590.       administrator.
  591.     </para>
  592.     <para>
  593.       If the computer is your personal workstation or home computer
  594.       and you are not worried about security, you can give mount
  595.       permission to ordinary users. The easiest way to allow this is
  596.       to use the application
  597.       <application><emphasis>linuxconf</emphasis></application> (which
  598.       can only be run by root).  Just select the drive you want to
  599.       access in the <guilabel>Access local drive</guilabel> section.
  600.       In the <guilabel>Options</guilabel> tab select the
  601.       <guilabel>User Mountable</guilabel> option.  Your drive will now
  602.       be mountable by users.
  603.     </para>
  604.     <para>
  605.       If <application><emphasis>linuxconf</emphasis></application> is
  606.       not available, then you must manually edit the file
  607.       <filename>/etc/fstab</filename> to include user access. This is
  608.       done by adding the <quote>user</quote> attribute to the
  609.       drive. For example:
  610.     </para>
  611.     <para>
  612.       If your <filename>fstab</filename> file contains a line like
  613.       this:
  614.     </para>
  615.       <programlisting>
  616. /dev/cdrom /mnt/cdrom iso9660 exec,dev,ro,noauto 0 0
  617.       </programlisting>
  618.       <para>
  619.       add the word <quote>user</quote> to the fourth column:
  620.     </para>
  621.     <programlisting>
  622. /dev/cdrom /mnt/cdrom iso9660 user,exec,dev,ro,noauto 0 0
  623.     </programlisting>
  624.   </sect1>
  625.  
  626.   <sect1 id="devices">
  627.     <title>Drives and devices</title>
  628.     <para>
  629.       Under UNIX, the word <quote>device</quote> is used for all
  630.       peripheral devices connected to your computer; this includes
  631.       hard drives, floppy and CD-ROM drives, audio and video cards,
  632.       serial and parallel ports, and much more. Each device has a
  633.       name, such as <filename>/dev/hda</filename>. The most common
  634.       device names are listed below (for Linux; other varieties of
  635.       UNIX may use slightly different device names).
  636.     </para>
  637.     <itemizedlist>
  638.       <listitem><para> <filename>/dev/hd*</filename> (where *=a,b,c,
  639.       …): these are IDE devices, such as hard drives,
  640.       CD-ROM drives and ZIP drives. <filename>/dev/hda</filename>
  641.       denotes the master drive on the first IDE controller
  642.       (usually your first hard drive, <filename>C:</filename>
  643.       under Windows), <filename>/dev/hdb</filename> is the slave
  644.       drive on the first controller (this can be a second hard
  645.       drive or a CD-ROM), and so on. See also the <link
  646.       linkend="zippartition">note</link> below about ZIP drives.
  647.       </para></listitem>
  648.  
  649.       <listitem><para>
  650.       <filename>/dev/sd*</filename> (where *=a,b,c, …):
  651.       these are SCSI devices, usually hard drives. 
  652.     </para></listitem>
  653.     </itemizedlist>
  654.  
  655.     <note>
  656.       <title>NOTE</title> 
  657.       <para>If the acronyms IDE and SCSI are new to you, here is a
  658.       brief explanation: there are two types of interfaces for hard
  659.       drives and other similar devices: IDE (and its cousins such as
  660.       EIDE, ATAPI, etc.) and SCSI. SCSI provides better performance,
  661.       but is more expensive, so it is mostly used on
  662.       servers. If you are not sure what kind of drives you have, most
  663.       probably it is IDE. </para>
  664.     </note> 
  665.     <itemizedlist>
  666.       <listitem><para>
  667.       <filename>/dev/fd*</filename> (where *=0,1, etc) are floppy
  668.       drives; <filename>/dev/fd0</filename> is the first drive (it
  669.       corresponds to <filename>A:</filename> under Windows),
  670.       <filename>/dev/fd1</filename> is the second
  671.       (<filename>B:</filename>), etc. 
  672.     </para>
  673.       </listitem>
  674.       <listitem><para>
  675.       <filename>/dev/lp*</filename> (where *=0,1, etc) are
  676.       parallel ports; most commonly, these ports are used to
  677.       connect a printer to the
  678.       computer. <filename>/dev/lp0</filename> corresponds to
  679.       <filename>LPT1</filename> under Windows,
  680.       <filename>/dev/lp1</filename> to <filename>LPT2</filename>,
  681.       etc.  
  682.     </para>
  683.       </listitem>
  684.       <listitem><para> <filename>/dev/ttyS*</filename> (where *=0,1,
  685.       etc) are serial ports; these ports are commonly used for
  686.       connecting a mouse or a
  687.       modem. <filename>/dev/ttyS0</filename> corresponds to
  688.       <filename>COM1</filename> under Windows,
  689.       <filename>/dev/ttyS1</filename> to <filename>COM2</filename>,
  690.       etc.
  691.     </para>
  692.       </listitem>
  693.       <listitem><para> 
  694.       <filename>/dev/audio</filename> and
  695.       <filename>/dev/dsp</filename> — these two device
  696.       names are used for your audio card (they are not equivalent,
  697.       since they are used for different types of audio files). 
  698.     </para>
  699.     </listitem>
  700.     </itemizedlist>
  701.     <para>
  702.       In addition, it is a common practice to have symlinks
  703.       <filename>/dev/floppy, /dev/modem</filename> and
  704.       <filename>/dev/cdrom</filename> pointing to the actual device
  705.       name corresponding to your floppy drive, modem, and CD-ROM drive
  706.       respectively.
  707.     </para>
  708.     <para>
  709.       You rarely need to use these device names. In particular, if you
  710.       want to access a file on a drive, you do not use the device name
  711.       (such as <filename>/dev/fd0</filename>); instead, you first
  712.       mount the device so that its contents shows as a subdirectory
  713.       (for example, <filename>/mnt/floppy</filename>) in the main
  714.       directory tree, and then use this directory for accessing
  715.       files; see <xref linkend="new-mount"> for more information. About
  716.       the only time when you actually need to use the device names is
  717.       when you are configuring some newly installed program. For
  718.       example, a fax program can ask you for the device name for your
  719.       modem (in which case you can either give it the actual device
  720.       name, such as <filename>/dev/ttyS1</filename>, or just use the
  721.       symlink <filename>/dev/modem</filename>).
  722.     </para>
  723.     <para> And just for fun: there is also a device
  724.     <filename>/dev/null</filename> which acts as a <quote>black
  725.     hole</quote>: you can send to it any information, and it never
  726.     returns. So if you do not want to be bothered by error messages,
  727.     re-direct them to <filename>/dev/null</filename> -:).
  728.     </para>
  729.  
  730.     <sect2 id="partitions">
  731.       <title>Partitions</title>
  732.       <para>
  733.     Note that it is possible to subdivide a hard drive (or a
  734.     similar device) into parts which for all practical purposes
  735.     behave as independent disks, even though physically they
  736.     reside on the same disk. These parts are called
  737.     <quote>partitions</quote> (under Windows, the name
  738.     <quote>logical disk</quote> is used). For example, you can
  739.     partition your hard drive into several partitions, and install
  740.     different operating systems in different partitions; you can
  741.     reformat each partition independently of the others. This
  742.     partitioning of the hard drive is usually done during the
  743.     installation of the operating system; refer to your
  744.     installation guide for more information.
  745.       </para>
  746.       <para> 
  747.     If your hard drive has been partitioned then each partition
  748.     is considered as a separate device. For example, if your hard
  749.     drive is <filename>/dev/hda</filename>, then the first
  750.     partition on this drive would be referred to as
  751.     <filename>/dev/hda1</filename>, the second as
  752.     <filename>/dev/hda2</filename>, and so on. 
  753.       </para>
  754.       <warning id="zippartition">
  755.     <title> Partitioning of ZIP disks</title> 
  756.  
  757.     <para> For reasons unknown to us, the pre-formatted
  758.       ZIP disks sold in stores or formatted using Iomega's ZIP
  759.       tools under Windows are partitioned in a strange way:
  760.       they have only one partition (of Windows type, of course),
  761.       but this partition has number 4. Thus, if your ZIP drive is
  762.       <filename>/dev/hdc</filename>, the correct device name you
  763.       should use for such disks is <filename>/dev/hdc4</filename>.
  764.     </para>
  765.       </warning>
  766.     </sect2>
  767.   </sect1>
  768.   <sect1 id="X11"> 
  769.     <title>Graphical user interface: X Window System, window
  770.       managers, and desktop environments.</title>
  771.     <para>
  772.       UNIX is a modular system: it consists of many components so that
  773.       a user (or system administrator) can choose those components he
  774.       needs.  In particular, there are several layers of software
  775.       responsible for graphical user interface. These layers are: X
  776.       Window System, window managers, and desktop environment.
  777.     </para>
  778.     <para> <emphasis>X Window System</emphasis> (also known as X, or
  779.       X11) is the component of UNIX systems responsible for virtually
  780.       all basic graphics — in particular, for drawing icons,
  781.       backgrounds, and windows in which your applications
  782.       work. Without X, you only have command line. X11 sets the screen
  783.       resolution and color depth, moves the mouse cursor around the
  784.       screen, etc. It serves as a foundation for other components of
  785.       graphical user interface such as window managers and desktop
  786.       environments.
  787.     </para>
  788.     <para> <emphasis>Window manager</emphasis> extends capabilities of
  789.       X Window System by placing borders and buttons around windows,
  790.       which allows the user to move, close, hide or resize the
  791.       windows. X11 is virtually always used in combination with a
  792.       window manager, since it would be pretty much unusable without
  793.       one. There are many window managers available for X11; most
  794.       popular are <application>fvwm</application>,
  795.       <application>mwm</application>, <application>kwm</application>
  796.       (used by KDE), <application>Enlightenment</application>, and
  797.       <application>Sawfish</application>.
  798.     </para>
  799.     <para> Finally, a <emphasis>desktop environment</emphasis> goes
  800.       one more step further than a window manager by adding a
  801.       graphical file manager from which you can drag-and-drop items on
  802.       your desktop, a panel which can be used to launch frequently
  803.       used applications, and a set of applications and utilities.
  804.       There are several desktop environments available for all
  805.       versions of UNIX; the most popular ones are <ulink type="http"
  806.       url="http://www.gnome.org">GNOME</ulink>, <ulink type="http"
  807.       url="http://www.kde.org">KDE</ulink> and <ulink type="http"
  808.       url="http://www.sun.com/solaris/cde/">CDE</ulink> (soon to be
  809.       replaced by GNOME).
  810.     </para>
  811.     <para> Most desktop environments contain a window manager as their
  812.       integral part; for example, KDE contains its own window manager,
  813.       <application>kwm</application> (it is possible to use KDE with
  814.       another window manager, but few people do so).  GNOME has no
  815.       window manager of its own; it will allow you to choose any
  816.       window manager you already have on your system. To make life
  817.       easier for new users, usually the
  818.       <application>Sawfish</application> window manager is distributed
  819.       with GNOME and is used by default; you can switch to
  820.       another window manager using <application>GNOME Control
  821.       Center</application>. Note however that you will need a
  822.       GNOME-compliant window manager to use such features of GNOME as 
  823.       session management, taskbar applet, etc. 
  824.     </para>
  825.  
  826.     </sect1>
  827.     
  828.   
  829. </article>
  830.  
  831.  
  832.  
  833.